package com.zmj.sy.mom.srv.aps.bean.vo.base;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class BaseResVo {

    public static final Integer SUCCESS_CODE = 0;
    public static final Integer FAIL_CODE = 1;
    @ApiModelProperty("返回结果  0 成功  1 失败")
    private Integer code;
    @ApiModelProperty("返回消息")
    private String message;

    public static BaseResVo fail(String message) {
        return new BaseResVo(FAIL_CODE, message);
    }

    public static BaseResVo ok(String message) {
        return new BaseResVo(SUCCESS_CODE, message);
    }

    public static BaseResVo ok() {
        return new BaseResVo(SUCCESS_CODE, null);
    }
}
